package com.jindy.module.order.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jindy.module.logisticscost.domain.LogisticsCost;
import lombok.Data;
import com.jindy.common.annotation.Excel;
import com.jindy.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 订单对象 t_order
 *
 * @author ruoyi
 * @date 2022-10-08
 */
@Data
public class Order extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 合同模板 */
    @Excel(name = "合同模板")
    private String contractTemplate;

    /** 发起人 */
    @Excel(name = "发起人")
    private Long sponsor;

    /** 发起人名称 */
    @Excel(name = "发起人名称")
    private String sponsorName;

    /** 业务员 */
    @Excel(name = "业务员")
    private Long salesman;

    /** 业务员名称 */
    @Excel(name = "业务员名称")
    private String salesmanName;

    /** 协同人 */
    @Excel(name = "协同人")
    private Long collaborator;

    /** 协同人名称 */
    @Excel(name = "协同人名称")
    private String collaboratorName;

    /** 信息提供人 */
    @Excel(name = "信息提供人")
    private Long informationProvider;

    /** 信息提供人名称 */
    @Excel(name = "信息提供人名称")
    private String informationProviderName;

    /** 发起人所属部门 */
    @Excel(name = "发起人所属部门")
    private Long sponsorDept;

    /** 发起人所属部门名称 */
    @Excel(name = "发起人所属部门名称")
    private String sponsorDeptName;

    /** 订单编号 */
    @Excel(name = "订单编号")
    private String orderNo;

    /** 订单发起日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单发起日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderDate;

    /** 业务所属公司 */
    @Excel(name = "业务所属公司")
    private String businessCompany;

    /** 订单类型 */
    @Excel(name = "订单类型")
    private String orderType;

    /** 客户 */
    @Excel(name = "客户")
    private Long customerId;

    /** 客户名称 */
    @Excel(name = "客户名称")
    private String customerName;

    /** 客户类别 */
    @Excel(name = "客户类别")
    private String customerCategory;

    /** 客户信息来源 */
    @Excel(name = "客户信息来源")
    private String customerSource;

    /** 客户所属省份 */
    @Excel(name = "客户所属省份")
    private String customerRegion;

    /** 项目名称 */
    @Excel(name = "项目名称")
    private String projectName;

    /** 项目地区域 */
    @Excel(name = "项目地区域")
    private String projectArea;
    /** 项目地区域名称 */
    @Excel(name = "项目地区域名称")
    private String projectAreaName;

    /** 项目信息来源 */
    @Excel(name = "项目信息来源")
    private String projectSource;

    /** 租赁形式 */
    @Excel(name = "租赁形式")
    private String lease;

    /** 收货地址 */
    @Excel(name = "收货地址")
    private String address;

    /** 收货人姓名 */
    @Excel(name = "收货人姓名")
    private String consigneeName;

    /** 收货人电话 */
    @Excel(name = "收货人电话")
    private String consigneeTel;

    /** 发货仓库id */
    @Excel(name = "发货仓库id")
    private Long deliveryWarehouseId;

    /** 发货仓库名称 */
    @Excel(name = "发货仓库名称")
    private String deliveryWarehouseName;

    /** 辅料说明 */
    @Excel(name = "辅料说明")
    private String accessoriesInstruction;

    /** 日租金合计 */
    @Excel(name = "日租金合计")
    private BigDecimal totalDailyRent;

    /** 租金合计 */
    @Excel(name = "租金合计")
    private BigDecimal totalRant;

    /** 应收押金（元） */
    @Excel(name = "应收押金", readConverterExp = "元=")
    private BigDecimal depositReceivable;

    /** 押金收取方式 */
    @Excel(name = "押金收取方式")
    private String depositCollectionMethod;

    /** 应收款 */
    @Excel(name = "应收款")
    private BigDecimal receivables;

    /** 附件 */
    @Excel(name = "附件")
    private String enclosure;

    /** 业务费情况 */
    @Excel(name = "业务费情况")
    private String businessExpenses;

    /** 期望到货日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "期望到货日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expectedArrivalDate;

    /** 运输方式 */
    @Excel(name = "运输方式")
    private String shippingType;

    /** 司机姓名 */
    @Excel(name = "司机姓名")
    private String driverName;

    /** 司机联系方式 */
    @Excel(name = "司机联系方式")
    private String driverTel;

    /** 车辆信息 */
    @Excel(name = "车辆信息")
    private String vehicleInformation;

    /** 发货状态 */
    @Excel(name = "发货状态")
    private String shipmentStatus;

    /** 订单状态 */
    @Excel(name = "订单状态")
    private String orderStatus;

    /** 情况说明 */
    @Excel(name = "情况说明")
    private String description;

    /** 出库状态 */
    @Excel(name = "出库状态")
    private String deliveryStatus;

    /** 已收金额 */
    @Excel(name = "已收金额")
    private BigDecimal receivedAmount;

    /** 未收金额 */
    @Excel(name = "未收金额")
    private BigDecimal unreceivedAmount;

    /** 坏账金额 */
    @Excel(name = "坏账金额")
    private BigDecimal badDebtAmount;

    /** 开票金额 */
    @Excel(name = "开票金额")
    private BigDecimal invoicedAmount;

    /** 未开票金额 */
    @Excel(name = "未开票金额")
    private BigDecimal uninvoicedAmount;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    private List<OrderProduct> productList;

    /**
     * 是否有对账单
     */
    private String haveReconciliation ;

    /** 项目id */
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 查看权限（用户id)
     */
    private Long userId;

    /**
     * 查看权限（用户id集合)
     */
    private List<Long> userIdList;

    /**
     * 部门负责人id
     */
    private Long leaderId;

    /** 订单合同 */
    @Excel(name = "订单合同")
    private String agreement;

    /** 是否超权限(1是,2否) */
    @Excel(name = "是否超权限")
    private String purview;

    /** 新增物流费用信息列表 */
    private List<LogisticsCost> logisticsCostList;

    /** 是否安排物流车辆（1是 2否）*/
    @Excel(name = "是否安排物流车辆")
    private String logistics;

    /** 包干总金额 */
    @Excel(name = "包干总金额")
    private BigDecimal lumpAmount;

    /** 包干情况说明*/
    @Excel(name = "包干情况说明")
    private String lumpRemark;

    /** 关联订单编号 */
//    @Excel(name = "关联订单编号")
    private String associatedOrderNo;

    /** 信息提供状态*/
    @Excel(name = "信息提供状态")
    private String informationState;

    /** 省*/
    @Excel(name = "省")
    private String province;

    /** 市*/
    @Excel(name = "市")
    private String city;

    /** 未收金额*/
    @Excel(name = "未收金额")
    private String uncollectedAmount;

    /** 入库完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "入库完成时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date warehouseTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("contractTemplate", contractTemplate)
                .append("sponsor", sponsor)
                .append("sponsorName", sponsorName)
                .append("salesman", salesman)
                .append("salesmanName", salesmanName)
                .append("collaborator", collaborator)
                .append("collaboratorName", collaboratorName)
                .append("informationProvider", informationProvider)
                .append("informationProviderName", informationProviderName)
                .append("sponsorDept", sponsorDept)
                .append("sponsorDeptName", sponsorDeptName)
                .append("orderNo", orderNo)
                .append("orderDate", orderDate)
                .append("businessCompany", businessCompany)
                .append("orderType", orderType)
                .append("customerId", customerId)
                .append("customerName", customerName)
                .append("customerCategory", customerCategory)
                .append("customerSource", customerSource)
                .append("customerRegion", customerRegion)
                .append("projectName", projectName)
                .append("projectArea", projectArea)
                .append("projectAreaName", projectAreaName)
                .append("projectSource", projectSource)
                .append("lease", lease)
                .append("address", address)
                .append("consigneeName", consigneeName)
                .append("consigneeTel", consigneeTel)
                .append("deliveryWarehouseId", deliveryWarehouseId)
                .append("deliveryWarehouseName", deliveryWarehouseName)
                .append("accessoriesInstruction", accessoriesInstruction)
                .append("totalDailyRent", totalDailyRent)
                .append("totalRant", totalRant)
                .append("depositReceivable", depositReceivable)
                .append("depositCollectionMethod", depositCollectionMethod)
                .append("receivables", receivables)
                .append("enclosure", enclosure)
                .append("businessExpenses", businessExpenses)
                .append("expectedArrivalDate", expectedArrivalDate)
                .append("shippingType", shippingType)
                .append("driverName", driverName)
                .append("driverTel", driverTel)
                .append("vehicleInformation", vehicleInformation)
                .append("shipmentStatus", shipmentStatus)
                .append("orderStatus", orderStatus)
                .append("description", description)
                .append("deliveryStatus", deliveryStatus)
                .append("receivedAmount", receivedAmount)
                .append("unreceivedAmount", unreceivedAmount)
                .append("badDebtAmount", badDebtAmount)
                .append("invoicedAmount", invoicedAmount)
                .append("uninvoicedAmount", uninvoicedAmount)
                .append("delFlag", delFlag)
                .append("productList", productList)
                .append("haveReconciliation", haveReconciliation)
                .append("projectId", projectId)
                .append("userId", userId)
                .append("userIdList", userIdList)
                .append("leaderId", leaderId)
                .append("agreement", agreement)
                .append("purview", purview)
                .append("logisticsCostList", logisticsCostList)
                .append("logistics", logistics)
                .append("lumpAmount", lumpAmount)
                .append("lumpRemark", lumpRemark)
                .append("associatedOrderNo", associatedOrderNo)
                .append("informationState", informationState)
                .append("province", province)
                .append("city", city)
                .append("uncollectedAmount", uncollectedAmount)
                .append("warehouseTime", warehouseTime)
                .toString();
    }
}
